package com.wtb.javatool.dao;

import com.wtb.javatool.entity.Project;
import com.wtb.javatool.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;

@Mapper
public interface ProjectMapper {

    ArrayList<Project> SelectProjectByStudentId(int studentId);

    ArrayList<Project> SelectProjectByIsPublic(int isPublic);

    Project SelectProjectDetailsByProjectId(int projectId);

    ArrayList<Tag> SelectAllTag ();
    // 接口方法修改
    ArrayList<Project> SelectProjectByInfo(
            @Param("projectName") String projectName,
            @Param("studentName") String studentName,
            @Param("stars") Integer stars  // 改为 Integer 包装类型
    );

    ArrayList<Project> SelectStudentProjectByInfo(
            @Param("studentId") Integer studentId,
            @Param("projectName") String projectName,
            @Param("studentName") String studentName,
            @Param("stars") Integer stars
    );

    ArrayList<Project> SelectProjectByCategory(int typeId,int optionId,int fatherOptionId);

    Integer addProject(Project project);

    Integer updateProject(Project project);
}
